package com.hotel.room.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hotel.room.mapper.RoomMapper;
import com.hotel.room.pojo.Room;

@Service
public class RoomService {
	@Autowired
	private RoomMapper roomMapper;

	public void addRoom(Room room) {
		roomMapper.insertRoom(room);
	}

	public void deleteRoom(int id) {
		roomMapper.deleteRoom(id);

	}

	public void updateRoom(Room room) {
		roomMapper.updateRoom(room);
		
	}

	public List<Room> queryRoom() {
	 return roomMapper.selectRoom();
	}

	public Room queryRoomById(int id) {
		
		return roomMapper.selectRoomById(id);
	}

	//order调用
	public Room selectRoomByType(String roomType) {
		return roomMapper.selectRoomByType(roomType);
	}

	public void updateRoomNumByType(int num,String roomType) {
		roomMapper.updateRoomNumByType(num, roomType);
	}


}
